<?php 
namespace Home\Controller;

class JobController extends HomeController {
    public function index(){
        $banner = M("Ad")->where(array('id'=>10))->find();
        $this->assign('banner',$banner);

        $list = M('Job')->order('sort asc , id desc')->select();
        $this->assign('list',$list);
        $this->display();
    }  

    public function info(){
        $id = I('get.id');
        if ($id=='' || !is_numeric($id)) {
            $this->error('参数错误');
        }

        $map['id'] = $id;
        $map['show'] = 1;
        $list = M('Job')->where($map)->find();
        if (!$list) {
            $this->error('信息不存在');
        }else{
            $this->assign('list', $list);
            $banner = M("Ad")->where(array('id'=>10))->find();
            $this->assign('banner',$banner);
            $this->display();
        }
    }
}